<?php

namespace app\controller;

use think\facade\Db;
use think\facade\Request;

class YardController
{
    public function getYardDetails()
    {
        session_start();
        
        
        $yard_id = Request::get('yard_id');
        if (!$yard_id) {
            return json(['error' => 'yard_id is required'], 400);
        }

        $yard = Db::name('cdydpt_info')->where('yard_id', $yard_id)->find();
        if (!$yard) {
            return json(['error' => 'Yard not found'], 404);
        }

        return json($yard);
    }
}
